import java.util.Scanner;

public class Test6 {
    public static void main(String[] args) {
        Student s = new Student();
        s.display();
        Scanner sc = new Scanner(System.in);
        String name = sc.next();
        int age = sc.nextInt();
        s.setName(name);
        s.setAge(age);
        s.display();
    }
}
class Student{
    private String name;
    private int age;
    public void display(){
        if(this.name == null){
            System.out.println("name:无名,age:7");
        }else {
            System.out.println("name:" + this.name + ",age:" + this.age);
        }
    }

    public Student() {
        this.age = 7;
        System.out.println("无参构造方法");
    }

    public Student(String name, int age) {
        this.name = name;
        if(age <= 6){
            this.age = 7;
        }else {
            this.age = age;
        }
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        if(age <= 6){
            this.age = 7;
        }else {
            this.age = age;
        }
    }

    public String toString() {
        return "Student{name = " + name + ", age = " + age + "}";
    }
}
